package test04.sync.test08.t1;

import java.util.Random;

/**
 * @Author lzp
 * @Date 2024-03-22
 */
public class Fruit {
    private String[]array = {"菠萝","苹果","葡萄","西瓜","香蕉","雪梨"};

    private int index;

    public void Fruit(){
        this.index = new Random().nextInt(this.array.length);
    }

    @Override
    public String toString() {
        return this.array[this.index];
    }

//    public static void main(String[] args) {
//        Fruit f =new Fruit();
//        System.out.println(f);
//    }

}
